using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class SEOutStockEntryMap : EntityTypeConfiguration<SEOutStockEntry>
    {
        public SEOutStockEntryMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FBrNo, t.FInterID, t.FEntryID });

            // Properties
            this.Property(t => t.FBrNo)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.FInterID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FEntryID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FOrderInterID)
                .HasMaxLength(30);

            this.Property(t => t.FNote)
                .IsFixedLength()
                .HasMaxLength(255);

            this.Property(t => t.FMapNumber)
                .IsRequired()
                .HasMaxLength(80);

            this.Property(t => t.FMapName)
                .HasMaxLength(256);

            this.Property(t => t.FBatchNo)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FExplanation)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FFetchAdd)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FSourceBillNo)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FContractBillNo)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FOrderBillNo)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FMTONo)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FEntrySelfS0241)
                .HasMaxLength(255);

            this.Property(t => t.FEntrySelfS0240)
                .HasMaxLength(255);

            // Table & Column Mappings
            this.ToTable("SEOutStockEntry");
            this.Property(t => t.FBrNo).HasColumnName("FBrNo");
            this.Property(t => t.FInterID).HasColumnName("FInterID");
            this.Property(t => t.FEntryID).HasColumnName("FEntryID");
            this.Property(t => t.FItemID).HasColumnName("FItemID");
            this.Property(t => t.FQty).HasColumnName("FQty");
            this.Property(t => t.FCommitQty).HasColumnName("FCommitQty");
            this.Property(t => t.FPrice).HasColumnName("FPrice");
            this.Property(t => t.FAmount).HasColumnName("FAmount");
            this.Property(t => t.FOrderInterID).HasColumnName("FOrderInterID");
            this.Property(t => t.FDate).HasColumnName("FDate");
            this.Property(t => t.FNote).HasColumnName("FNote");
            this.Property(t => t.FInvoiceQty).HasColumnName("FInvoiceQty");
            this.Property(t => t.FBCommitQty).HasColumnName("FBCommitQty");
            this.Property(t => t.FUnitID).HasColumnName("FUnitID");
            this.Property(t => t.FAuxBCommitQty).HasColumnName("FAuxBCommitQty");
            this.Property(t => t.FAuxCommitQty).HasColumnName("FAuxCommitQty");
            this.Property(t => t.FAuxInvoiceQty).HasColumnName("FAuxInvoiceQty");
            this.Property(t => t.FAuxPrice).HasColumnName("FAuxPrice");
            this.Property(t => t.FAuxQty).HasColumnName("FAuxQty");
            this.Property(t => t.FSourceEntryID).HasColumnName("FSourceEntryID");
            this.Property(t => t.FMapNumber).HasColumnName("FMapNumber");
            this.Property(t => t.FMapName).HasColumnName("FMapName");
            this.Property(t => t.FAuxPropID).HasColumnName("FAuxPropID");
            this.Property(t => t.FBatchNo).HasColumnName("FBatchNo");
            this.Property(t => t.FCheckDate).HasColumnName("FCheckDate");
            this.Property(t => t.FExplanation).HasColumnName("FExplanation");
            this.Property(t => t.FFetchAdd).HasColumnName("FFetchAdd");
            this.Property(t => t.FFetchDate).HasColumnName("FFetchDate");
            this.Property(t => t.FMultiCheckDate1).HasColumnName("FMultiCheckDate1");
            this.Property(t => t.FMultiCheckDate2).HasColumnName("FMultiCheckDate2");
            this.Property(t => t.FMultiCheckDate3).HasColumnName("FMultiCheckDate3");
            this.Property(t => t.FMultiCheckDate4).HasColumnName("FMultiCheckDate4");
            this.Property(t => t.FMultiCheckDate5).HasColumnName("FMultiCheckDate5");
            this.Property(t => t.FMultiCheckDate6).HasColumnName("FMultiCheckDate6");
            this.Property(t => t.FSecCoefficient).HasColumnName("FSecCoefficient");
            this.Property(t => t.FSecQty).HasColumnName("FSecQty");
            this.Property(t => t.FSecCommitQty).HasColumnName("FSecCommitQty");
            this.Property(t => t.FSourceTranType).HasColumnName("FSourceTranType");
            this.Property(t => t.FSourceInterId).HasColumnName("FSourceInterId");
            this.Property(t => t.FSourceBillNo).HasColumnName("FSourceBillNo");
            this.Property(t => t.FContractInterID).HasColumnName("FContractInterID");
            this.Property(t => t.FContractEntryID).HasColumnName("FContractEntryID");
            this.Property(t => t.FContractBillNo).HasColumnName("FContractBillNo");
            this.Property(t => t.FOrderEntryID).HasColumnName("FOrderEntryID");
            this.Property(t => t.FOrderBillNo).HasColumnName("FOrderBillNo");
            this.Property(t => t.FStockID).HasColumnName("FStockID");
            this.Property(t => t.FBackQty).HasColumnName("FBackQty");
            this.Property(t => t.FAuxBackQty).HasColumnName("FAuxBackQty");
            this.Property(t => t.FSecBackQty).HasColumnName("FSecBackQty");
            this.Property(t => t.FStdAmount).HasColumnName("FStdAmount");
            this.Property(t => t.FPlanMode).HasColumnName("FPlanMode");
            this.Property(t => t.FMTONo).HasColumnName("FMTONo");
            this.Property(t => t.FEntrySelfS0236).HasColumnName("FEntrySelfS0236");
            this.Property(t => t.FEntrySelfS0237).HasColumnName("FEntrySelfS0237");
            this.Property(t => t.FEntrySelfS0241).HasColumnName("FEntrySelfS0241");
            this.Property(t => t.FEntrySelfS0242).HasColumnName("FEntrySelfS0242");
            this.Property(t => t.FEntrySelfS0240).HasColumnName("FEntrySelfS0240");
            this.Property(t => t.FEntrySelfS0243).HasColumnName("FEntrySelfS0243");
        }
    }
}
